import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.logging.SimpleFormatter;

public class Main{
    void getMonday(Date date){
        DateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Calendar cal = Calendar.getInstance();
        cal.setTime(date);

        System.out.println("这是第星期"+cal.get(Calendar.DAY_OF_WEEK-1));
    }
    public static void main(String[] args) {
        //字符出现次数
        String name="STALKERSSSTTTRRR";
        String seluction="";
        char[] chars = name.toCharArray();

        ArrayList arr = new ArrayList();

        for(int i=0; i<chars.length; i++) {
            int showNumber=0;
            for(int j=0; j<chars.length; j++) {
                if(chars[i]==chars[j]){
                    showNumber++;
                }
            }
            if(seluction.indexOf(chars[i])>=0){

            }else{
                seluction+=(""+chars[i])+showNumber;
            }
        }
        System.out.println(seluction);


        //出生后日期
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR,2020);
        cal.set(Calendar.MONTH,10);
        cal.set(Calendar.DAY_OF_MONTH,28);

        for(int i=28; i<=10000-28; i++) {
            cal.set(Calendar.DAY_OF_MONTH,i);
        }

        System.out.println("小明出生后的日期是"+cal.get(Calendar.YEAR)+"-"+cal.get(Calendar.MONTH)+"月-"+cal.get(Calendar.DAY_OF_MONTH)+"日");

        Main main=new Main();
        main.getMonday(new Date());
    }

}
